<div class="control-group">
    <? $name_id = preg_replace('/[^a-zA-Z0-9_%\[().\]\\/-]/s', '', camelize($attribute['name']));?>
    <label class="control-label"><?=$attribute['name'];?>:</label>

    <div class="controls docs-input-sizes">

        <?
            if($post_action=='EDIT'):
                if ($name_id=='name')
                {
                    $attrValue = $object[$name_id];
                }else
                {
                    $attrValue = isset($fields[$name_id]) ? $fields[$name_id] : '';
                }
                endif;
        ?>

        <input type="text" class="input-xlarge" name="<?=$name_id?>" id="<?=$name_id?>" value="<?if($post_action=='EDIT')echo $attrValue;?>" tabindex="<?=$counter?>">

    </div>

</div>